<?php 
require('common.inc.php');
getsessiontime();
header("Content-type:application/vnd.ms-excel"); 
header("Content-Disposition:filename=test.xls"); 
$username=checkstr($_GET['quser']);
$type=checkstr($_GET['type']);
$time1=$_GET['time1'];
$time2=$_GET['time2'];
$filter="where is_cross=1 and  type= ".$type;
if (trim($username)!="") $filter.=" and uname='".trim($username)."'";
if (trim($time1)!="") $filter.=" and ctime>='".strtotime($time1)."'";
if (trim($time2)!="") $filter.=" and ctime<='".(strtotime($time2)+3600*24)."'";

$db->query("select * from ld_transfer_coin   $filter order by ctime asc");

$list=$db->rs;
if(!$list){
	return;
}
echo "账号\t";echo "兑换数量\t";echo "兑换单价\t";echo "金额\t";echo "地址\t";echo "txid\t";echo "兑换时间\t\n";
foreach ($list as $key => $v) {
	if($v['ctype']==0){
	     $xftype='本金';
    }elseif($v['ctype']==1){
		 $xftype='利息';
    }elseif($v['ctype']==2){
		 $xftype='动态';
    }elseif($v['ctype']==3){
		 $xftype='晋级';
    }

	echo $v["cuname"]."\t";
	echo $v["num"]."\t";
	echo $v["cprice"]."\t";
	echo $v["ctotal"]."\t";
	echo $v["caddress"]."\t";
	echo $v["txid"]."\t";

	echo date("Y-m-d H:i",$v["ctime"])."\t\n";
}

?> 